//
//  SINACourseSigneModel.m
//  sinashebao
//
//  Created by  androidlongs on 2017/12/27.
//  Copyright © 2017年  androidlongs. All rights reserved.
//

#import "SINAStudentServiceItemModel.h"

@implementation 
SINAStudentServiceItemModel

-(instancetype)initWithDict:(NSDictionary *)dict{
    if (self==[super init]) {
        //姓名
        self.userName = [NSString stringWithFormat:@"%@", dict[@"releaser"]];
          self.nickname = [NSString stringWithFormat:@"%@", dict[@"nickname"]];
        
        if (self.userName.length<1||[self.userName isEqualToString:@"(null)"]) {
            self.userName = [NSString stringWithFormat:@"%@", dict[@"realname"]];
        }
        self.userUUID = [NSString stringWithFormat:@"%@", dict[@"createuseruuid"]];
        if (self.userUUID.length<1||[self.userUUID isEqualToString:@"(null)"]) {
            self.userUUID = @"";
        }
        self.serviceUUID=[NSString stringWithFormat:@"%@", dict[@"uuid"]];
        
        //服务时间
        self.serviceStartTime = dict[@"starttime"];
        self.serviceEndTime = dict[@"endtime"];
        //地址
        self.serviceLocation =[NSString stringWithFormat:@"%@", dict[@"releaseaddress"]];
        if (self.serviceLocation.length<1||[self.serviceLocation isEqualToString:@"(null)"]) {
            self.serviceLocation=@"无";
        }
        //性别
        NSString *sext=[NSString stringWithFormat:@"%@",dict[@"sex"]];
        NSInteger sexValue = -1;
        if (sext!=nil&&sext.length>0) {
            sexValue = [sext integerValue];
        }
        self.userSex= sexValue;
        
        //QQ
        self.qqOrEmail=[NSString stringWithFormat:@"%@",dict[@"email_qq"]];
        
        //快递公司
        self.sbuyBehal=dict[@"expresstype"];
        //电话
        self.servicePhone=dict[@"releasephone"];
        if (self.servicePhone.length<1||[self.servicePhone isEqualToString:@"(null)"]) {
            self.servicePhone = [NSString stringWithFormat:@"%@", dict[@"phone"]];
        }
        //酬金
        self.moneyNumber=dict[@"pay"];
        
        //备注
        self.remarkDes = dict[@"content"];
        
        //代购方式
        self.purchasetype= dict[@"purchasetype"];
        
        //头像
        self.userTitleImageUrl=dict[@"headimg"];
        [self.userTitleImageUrl stringByReplacingOccurrencesOfString:@"\\" withString:@"//"];
    }
    return self;
}
+(instancetype)askWithDic:(NSDictionary *)dict{
    
    return [[self alloc]initWithDict:dict];
}
@end
